package com.jzo2o.customer.controller.worker;

import com.jzo2o.customer.model.dto.request.BankAccountUpsertReqDTO;
import com.jzo2o.customer.model.dto.response.BankAccountResDTO;
import com.jzo2o.customer.service.IServerBankAccountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController("serverBankAccountController")
@RequestMapping("/worker/bank-account")
@Api(tags = "服务端 - 银行账户相关接口")
public class ServerBankAccountController {

    @Autowired
    private IServerBankAccountService serveBankService;

    @ApiOperation("新增或更新银行账户信息接口")
    @PostMapping
    public void addOrUpdateBankAccount(@RequestBody BankAccountUpsertReqDTO bankAccount){
        //这里面都是服务人员 调用下游接口
        serveBankService.serverBankAccountAddOrUpdate(bankAccount);
    }

    @ApiOperation("获取当前用户银行账户信息")
    @GetMapping("/currentUserBankAccount")
    public BankAccountResDTO getCurrentUserBankAccount(){
        return serveBankService.getCurrentUserBankAccount();
    }
}
